package com.dykj.fireFighting.web.rocketmq.producer;

import com.dykj.fireFighting.web.model.haiman.HaiManSmoke;
import com.dykj.fireFighting.web.rocketmq.message.InsertDevHisSmokeMessage;
import org.apache.rocketmq.client.producer.SendCallback;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @author zhengbo
 */
@Component
public class InsertDevHisSmokeProducer {
    @Autowired
    private RocketMQTemplate rocketMQTemplate;

    public void asyncSend(HaiManSmoke haiManSmoke, SendCallback callback) {
        InsertDevHisSmokeMessage insertDevHisSmokeMessage = new InsertDevHisSmokeMessage();
        insertDevHisSmokeMessage.setHaiManSmoke(haiManSmoke);
        rocketMQTemplate.asyncSend(InsertDevHisSmokeMessage.TOPIC, insertDevHisSmokeMessage, callback);
    }
}
